package com.financing.platform.service.impl;


import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IWxShopInfoDao;
import com.financing.platform.dto.WxShopInfoDTO;
import com.financing.platform.service.IWxShopInfoService;
/**
 * wx_shop_info  
 * 店铺信息表 业务访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("wxShopInfoService")
public class WxShopInfoServiceImpl implements IWxShopInfoService{

	@Autowired
	private IWxShopInfoDao wxShopInfoDao;

	@Override
	public int insert(WxShopInfoDTO wxShopInfo) throws SQLException {
		return wxShopInfoDao.insert(wxShopInfo);
	}

	@Override
	public void update(WxShopInfoDTO wxShopInfo) throws SQLException {
		wxShopInfoDao.update(wxShopInfo);
	}

	@Override
	public void updateForce(WxShopInfoDTO wxShopInfo) throws SQLException {
		wxShopInfoDao.updateForce(wxShopInfo);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		wxShopInfoDao.delete(id);
	}
	
	@Override
	public List<WxShopInfoDTO> queryList(WxShopInfoDTO wxShopInfo) throws SQLException {
		return wxShopInfoDao.queryList(wxShopInfo);
	}

	@Override
	public int queryListCount(WxShopInfoDTO wxShopInfo) throws SQLException {
		return wxShopInfoDao.queryListCount(wxShopInfo);
	}

	@Override
	public WxShopInfoDTO loadById(Integer id) throws SQLException {
		return wxShopInfoDao.loadById(id);
	}
 	@Override
	public WxShopInfoDTO queryListGetFirst(WxShopInfoDTO wxShopInfo)
			throws SQLException {
		 List<WxShopInfoDTO> queryList = queryList(wxShopInfo);
		 if(queryList==null||queryList.size()==0){
			 return new WxShopInfoDTO();
		 }
		 return queryList.get(0);
	}
}
